﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using UBCon.Core.Enums;
using UBCon.Ribbon.Interfaces;

namespace UBCon.Ribbon
{
    //[System.Windows.Markup.ContentProperty("Title")]
    public sealed class RibbonButton:Button, IRibbonControl
    {
        #region Constructors

        static RibbonButton() 
        {
            System.Type ownerType=typeof(RibbonButton);
            RibbonButton.DefaultStyleKeyProperty.OverrideMetadata(ownerType, new System.Windows.FrameworkPropertyMetadata(ownerType));
        }
        #endregion

        #region Properties

        public RibbonControlSize Size
        {
            get { return (RibbonControlSize)GetValue(SizeProperty); }
            set { SetValue(SizeProperty, value); }
        }

        // Using a DependencyProperty as the backing store for Size.  This enables animation, styling, binding, etc...
        public static readonly System.Windows.DependencyProperty SizeProperty =
            System.Windows.DependencyProperty.Register("Size", typeof(RibbonControlSize), typeof(RibbonButton), new System.Windows.PropertyMetadata(RibbonControlSize.Small));

        public System.Windows.Media.ImageSource Image
        {
            get { return (System.Windows.Media.ImageSource)GetValue(ImageProperty); }
            set { SetValue(ImageProperty, value); }
        }

        // Using a DependencyProperty as the backing store for Image.  This enables animation, styling, binding, etc...
        public static readonly System.Windows.DependencyProperty ImageProperty =
            System.Windows.DependencyProperty.Register("Image", typeof(System.Windows.Media.ImageSource), typeof(RibbonButton), new System.Windows.PropertyMetadata(null));

        public string Title
        {
            get { return (string)GetValue(TitleProperty); }
            set { SetValue(TitleProperty, value); }
        }

        // Using a DependencyProperty as the backing store for Title.  This enables animation, styling, binding, etc...
        public static readonly System.Windows.DependencyProperty TitleProperty =
            System.Windows.DependencyProperty.Register("Title", typeof(string), typeof(RibbonButton), new System.Windows.PropertyMetadata((string)null));

        internal IRibbonControl ParentUI { get; set; }

        #endregion

        #region Depenency Property Changed Callbacks

        #endregion

        #region Overrides
        #endregion

        #region Private Utilities
        #endregion

        #region Event Handlers
        #endregion

        #region Fields
        #endregion

        #region Events
        #endregion

        #region IRibbonControl Implementation

        /// <summary>
        /// Gets a boolean value indicating whether the contol's size is large
        /// </summary>
        public bool IsLarge
        {
            get { return this.Size == RibbonControlSize.Large; }
        }

        #endregion
       
    }
}
